<?php
/**
 * <https://y.st./>
 * Copyright © 2016 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Taking Cyrus&apos; laptop',
	'<{body}>' => <<<END
<p>
	<del>I found that for some reason, all my pages are using $a[XML] version 1.0.
	I don&apos;t really have any reason not to upgrade, so I upgraded.</del> <ins>As it turns out, neither my Web browser nor the <a href="https://validator.w3.org./nu/">$a[XHTML] validator</a> can actually handle $a[XML] version 1.1 for some reason.
	I had to revert back to $a[XML] version 1.0 to make everything work.
	I&apos;m not yet sure if this is a bug in the Web browser and validator or if $a[XHTML] is limited to using $a[XML] 1.0.
	I&apos;ll have to look into that tomorrow.</ins>
</p>
<p>
	At first, I couldn&apos;t bring myself to actually ask for help in <a href="ircs://sbuk7aqcxkoyipwv.onion:49152/%23WHATWG">#WHATWG</a>, but after a bit, I sucked it up and asked if anyone had any ideas.
	TabAtkins said that table layouts aren&apos;t as standardized as they could be, but pointed me toward a draft specification.
	Assuming that I could make heads or tails of what it was saying, I think I found the <a href="https://drafts.csswg.org/css-tables/#width-distribution-algorithm">section</a> that would have helped me.
	But while I couldn&apos;t figure out what the draft meant, I did come up with an idea.
	After calculating each column&apos;s minimum length by finding the length of the longest word in each cell, I&apos;ll find the cell in each column that contains the longest string for that column.
	I can then use those string lengths to find a general ratio between column widths and apply it based on the width of the table.
	It&apos;s imperfect and will sometimes get the answer wrong, but it should work fairly well.
	Even that seems like a daunting task when performed iteratively though.
	Table cells can contain whole tables.
	I might end up instead using comma-separated value syntax instead, though I&apos;ll need to somehow escape commas and new line characters, especially when dealing with nested tables.
	A serialized, multidimensional array might also work, though I think that that would be too difficult to read and should be avoided.
	I&apos;ve finished all non-table-related work on the class, at least for now, though it could use some fine-tuning later.
	For example, unordered list support currently has two problems.
	First, item numbers aren&apos;t treated as the text for list item bullet points.
	Instead, pound signs are used as the bullet points and the item numbers are treated as a textual part of the listed item.
	This is due to the fact that we don&apos;t know what the longest item number is until we completely finish processing the list.
	Unless we know what the longest number is, we don&apos;t know how far to indent the list to accommodate all of the numbered items.
	Second, reversed lists that don&apos;t specify a starting number begin at one, just like forward lists.
	Again, this is because we can&apos;t calculate the starting number until it&apos;s too late.
	Until we have a way to process the lists before processing the lists, I&apos;m not sure how to fix these bugs.
	For the record, I would prefer to start lists at zero, but I&apos;m trying to follow the <a href="https://www.w3.org./TR/html5/grouping-content.html#the-li-element">standard</a> as much as is feasible.
</p>
<p>
	One of the grocery/department stores contacted me today to offer me a job.
	I had to decline, saying that I was only going to be in the area a couple more months.
	That was a bit sad, I think that it would have been a more long-term job than some others that I could have found.
</p>
<p>
	When Cyrus got home, he informed me that before he left, our mother said that she was going to take his laptop when he left.
	That must be frustrating.
	He was worried about her taking it before, but he hadn&apos;t told me that our mother&apos;d actually said anything about planning to take it.
	He wanted to back up his files, so I offered to lend him the SHYDRIVE, but he didn&apos;t take me up on that.
	I bet that most of his files would fit on that, especially if he deleted the music that he got from me.
	He could download the music from my computer once he had his new machine bought and set up.
</p>
END
);
